package com.wetest.uia2.stub.watcher;

import androidx.test.uiautomator.UiObject;
import androidx.test.uiautomator.UiSelector;
import androidx.test.uiautomator.UiWatcher;

/* loaded from: classes5.dex */
public abstract class SelectorWatcher implements UiWatcher {
    private UiSelector[] conditions;

    public abstract void action();

    public SelectorWatcher(UiSelector[] conditions) {
        this.conditions = null;
        this.conditions = conditions;
    }

    @Override // androidx.test.uiautomator.UiWatcher
    public boolean checkForCondition() {
        for (UiSelector s : this.conditions) {
            UiObject obj = new UiObject(s);
            if (!obj.exists()) {
                return false;
            }
        }
        action();
        return true;
    }
}